﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
/// <summary>
/// Bind 的摘要说明
/// </summary>
public class Bind
{
	public Bind()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
  
	}
    public DataTable GetTab(int id)
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "select Name,Url from Tab where tabid="+id+" order by indexid ";
        SqlDataAdapter da = new SqlDataAdapter(sql,con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        return ds.Tables[0];

    }
    public DataSet ClassInfo()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "select * from ClassInfo order by EntranceTime desc";
        SqlDataAdapter da = new SqlDataAdapter(sql,con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        return ds;

    }
    public DataSet  studentInfo()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "select * from studentInfo";
        SqlDataAdapter da = new SqlDataAdapter(sql,con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        return ds;
  
    }
    public DataSet Teaccher()
    {

        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "select * from TeacherInfo";
        SqlDataAdapter da = new SqlDataAdapter(sql,con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        return ds;
   
    }

}
